package org.itsolutions.javaBackup.gui.web.admin;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;

import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.Singleton;
import com.vaadin.Application;
import com.vaadin.terminal.gwt.server.AbstractApplicationServlet;

/**
 * 
 * @author Tomas Fecko
 */
@Singleton
public class AdminApplicationServlet extends AbstractApplicationServlet {

	private static final long 							serialVersionUID = -7589360422980959931L;
    private final Provider<AdministrationApplication> 	mProvider;
    
    /**
     * 
     * @param pProvider provider
     */
    @Inject AdminApplicationServlet(Provider<AdministrationApplication> pProvider) {
        mProvider = pProvider;
    }


	@Override
	protected final AdministrationApplication getNewApplication(HttpServletRequest pRequest) throws ServletException {
		return mProvider.get();
	}

	@Override
	protected final Class<? extends Application> getApplicationClass() throws ClassNotFoundException {
		return AdministrationApplication.class;
	}
}




